import 'package:flutter/material.dart';
import 'package:honeypotflutter/modules/billing/page/billing/logic.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/publicBussine/bussine_font.dart';
import 'package:honeypotflutter/publicBussine/bussine_image.dart';
import 'package:honeypotflutter/publicBussine/loginInfo/bussine_userInfo.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_card.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_switchMonry.dart';

class BillingHeader extends StatelessWidget {
  BillingHeader({super.key});

  final BillingLogic _logic = Get.find<BillingLogic>();

  @override
  Widget build(BuildContext context) {
    return MGCard(
      backColor: MGColors.themeColor.withOpacity(0.7),
      padding: EdgeInsets.only(top: 30, bottom: 15, left: 12, right: 12),
      margin: EdgeInsets.only(top: 12, bottom: 12),
      children: [
        GetBuilder<UserInfoLogic>(
            init: UserInfoLogic(),
            builder: (controller) {
              return MGSwitchMonry(
                color: MGColors.text1Color,
                crossAxisAlignment: CrossAxisAlignment.center,
                monry: controller.userInfo.accountBalance,
              );
            }),
        SizedBox(height: 20),
        Row(
          children: [
            InkWell(
              child: Row(
                children: [
                  Obx(
                    () => Text(
                      _logic.selectDate.value,
                      style: TextStyle(
                        fontSize: MGFont.textFont3,
                        color: MGColors.text1Color,
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.only(left: 10),
                    child: Image.asset(
                      MGImage.image("account_billing", type: ImagePathType.account),
                      width: 14,
                    ),
                  )
                ],
              ),
              onTap: _logic.selectDatePickView,
            ),
            Obx(() => Text(
                  _logic.monryBilling.value,
                  style: TextStyle(
                    fontSize: MGFont.textFont3,
                    color: MGColors.text1Color,
                    fontWeight: FontWeight.bold,
                  ),
                ))
          ],
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
        )
      ],
    );
  }
}
